package tests;

import java.util.Iterator;

public class SwingTest {

	/**
	 * @param args
	 */
	// Globale Variablen
	static int wortindex = 1;

	// Methoden
	public static String randomWort(String[] strArray) {
		String temp;
		if (wortindex == strArray.length) {
			wortindex++;
			return strArray[0];
		} else {
			int i = (int) (Math.random() * (strArray.length - wortindex));
			temp = strArray[i];
			strArray[i] = strArray[strArray.length-wortindex];
			strArray[strArray.length-wortindex] = temp;
			wortindex++;
			return temp;
		}
	}

	public static void main(String[] args) {
		String[] woerter = { "AAA", "BBB", "CCC", "DDD" };
		wortindex = 1;
		while (wortindex <= woerter.length) {
			for (String string : woerter) {
				System.out.print(string+" " );
			}
			System.out.println();
			System.out.println("Random: "+randomWort(woerter));
		}

	}

}
